using zhwy.saas.api.Entity.Sys;

namespace zhwy.saas.api.Services.Sinterface.Sys
{
    /// <summary>
    /// 用户角色关联服务接口
    /// </summary>
    public interface ISysUserRoleService : IBaseService<Users_rolesEntity>
    {
        /// <summary>
        /// 批量分配用户角色
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="roleIds">角色ID列表</param>
        /// <returns>是否分配成功</returns>
        Task<bool> AssignRolesAsync(long userId, List<int> roleIds);

        /// <summary>
        /// 移除用户的所有角色
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>是否移除成功</returns>
        Task<bool> RemoveUserRolesAsync(long userId);

        /// <summary>
        /// 获取用户的角色ID列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>角色ID列表</returns>
        Task<List<int>> GetRoleIdsByUserIdAsync(long userId);

        /// <summary>
        /// 检查用户是否拥有指定角色
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <param name="roleId">角色ID</param>
        /// <returns>是否拥有角色</returns>
        Task<bool> HasRoleAsync(long userId, int roleId);
        /// <summary>
        /// 租户添加默认角色
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<bool> AddTeanantRoleAsync(long userId);
    }
}